package edu.scut.course_management.dto;

import java.util.List;

import edu.scut.course_management.po.Attachment;

/**
 * 用于封装接收 提交作业 接口的数据
 * @author huaming
 */
public class SubmitHomeworkDTO {
    private Integer homeworkId;
    private String studentId;
    private String answerContent;
    private List<Attachment> answerAttachments;

    public int getHomeworkId() {
        return homeworkId;
    }

    public void setHomeworkId(int homeworkId) {
        this.homeworkId = homeworkId;
    }

    public String getStudentId() {
        return studentId;
    }


    public void setStudentId(String studentId) {
        this.studentId = studentId;
    }

    public String getAnswerContent() {
        return answerContent;
    }

    public void setAnswerContent(String answerContent) {
        this.answerContent = answerContent;
    }

    public List<Attachment> getAnswerAttachments() {
        return answerAttachments;
    }

    public void setAnswerAttachments(List<Attachment> answerAttachments) {
        this.answerAttachments = answerAttachments;
    }
    
    // 回复内容和回复附件不能同时为空
    public boolean notNull() {
        return !(homeworkId==null || studentId==null || (answerContent==null && answerAttachments==null));
    }


}
